require './settings.rb'
require './mtgox_connector.rb'
require './ticker.rb'
require './DB.rb'
require './balance.rb'


def sell
  Logger.instance.log_with_timestamp("SELL COINS")
  puts MtGox_Connector.sell_Market(2.64, 1)
end

def buy
  Logger.instance.log_with_timestamp("BUY COINS")
  puts MtGox_Connector.buy_Market(2.1, 18)
end

#puts MtGox_Connector.get_Orders

#ticker = MtGox_Connector.get_Ticker
#sell if(ticker.Last <= 14)
#buy if(ticker.Last >= 17.5)

DB.Init 

@bal = Balance.instance
puts @bal

@bal.usd = 30
@bal.bitcoin = 3.0
@bal.update_instance

# TBD made Wrapper for balance


